package com.itheima.job;

import com.itheima.Util.DateUtils;
import com.itheima.dao.OrderSettingDao;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;


/**
 * @ClassName CleanOrderSettingJob
 * @Description 定时清理过时的可预约人数设置
 * @Author 传智播客
 * @Date 2019/7/17 9:21
 * @Version 1.0
 **/
public class CleanOrderSettingJob {


   @Autowired
   private OrderSettingDao orderSettingDao;

   public void doCleanOrderSetting(){
      Date lastDayOfPreviousMonth = DateUtils.getLastDayOfPreviousMonth();
      String lastDayOfPreMonth= DateUtils.parseDate2String(lastDayOfPreviousMonth,"yyyy-MM-dd");
      orderSettingDao.deleteOrderSetting(lastDayOfPreMonth);

   }


}
